<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>创建链接和脚注</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <h2 id="links">创建链接和注释</h2>

  <p class="h2subheading">— 链接文字 —</p>

  <p>Sigil allows you to easily link text to other parts of your book, such as chapter names and notes, so that readers can select the link and jump to the identified text.</p>
  <p>Sigil 使您可以轻松地将文本链接到书的其他部分，例如章节名称和注释，以便读者可以选择链接并跳转到标识的文本。</p>

  <h3 class="sigil_not_in_toc">IDs</h3>

  <p>In order for Sigil to create a link from certain words in your book to other locations in your book, you first need to give a name or ID to the text you want your link to go to.</p>
  <p>为了使 Sigil 创建从书中某些单词到书中其他位置的链接，您首先需要为要链接的文本指定名称或 ID。</p>

  <p>If the target for your link is just the top of a file, then you don’t need to do anything since you can use the filename as the target ID.</p>
  <p>如果链接的目标只是文件的顶部，那么您无需执行任何操作，因为您可以使用文件名作为目标 ID。</p>

  <p>But if you want to point to specific words in your book, then you need to assign a name or ID to the text.</p>
  <p>但是，如果要指向书中的特定单词，则需要为文本指定名称或 ID。</p>

  <div class="tip">
    <p class="tiptext">An ID is just a unique name, like <span class="example">note1</span> that you will assign to a some of your text so that you can refer to it. ID names must be unique within an HTML file (and start with a letter), but its best if they are unique throughout the whole EPUB in case you move text around.</p>
    <p class="tiptext">ID 只是一个唯一的名称，例如 <span class="example">note1</span>，您将为其分配一些文本，以便您引用它。ID 名称在 HTML 文件中（以字母开头）必须是唯一的，但是如果它们在整个 EPUB 中都是唯一的，则最好使用 ID 名称，以防您移动文本。</p>

    <p class="tiptext">IDs and links are usually created with the HTML anchor tag ("a") – so the ID is often considered the anchor ID for a link, hence the button used for inserting IDs.</p>
    <p class="tiptext">ID 和链接通常使用 HTML 锚标记（“a”）创建——因此，该 ID 通常被视为链接的锚 ID，因此使用按钮来插入 ID。</p>
  </div>

  <h4 class="sigil_not_in_toc">创建一个 ID</h4>

  <p>To create an ID, select some text in your book and click on the Insert ID button <img alt="insert-id_22px" src="../Images/insert-id_22px.png"/>:</p>
  <p>要创建 ID，请在您的书中选择一些文本，然后单击“插入 ID”按钮 <img alt="insert-id_22px" src="../Images/insert-id_22px.png"/>：</p>

  <div class="image">
    <img alt="tutorial-link-insert-id" src="../Images/tutorial-link-insert-id.png"/>
  </div>

  <p>This will open the Insert ID dialog where you can type the name of your ID:</p>
  <p>这将打开“插入 ID ”对话框，您可以在其中键入 ID 名称：</p>

  <div class="image">
    <img alt="tutorial-link-insert-id-dialog" src="../Images/tutorial-link-insert-id-dialog.png"/>
  </div>

  <h3 class="sigil_not_in_toc">链接</h3>

  <p>A link is a way to point to your ID, and when selected by the reader it "jumps" the reader to the location of the ID.</p>
  <p>链接是指向您的 ID 的一种方式，当读者选择该链接时，它会将读者“跳转”到 ID 的位置。</p>

  <p>To create a link in Sigil, select some text to use for the link and click on the Insert Link button <img alt="insert-hyperlink_22px" src="../Images/insert-hyperlink_22px.png"/>:</p>
  <p>要在 Sigil 中创建链接，请选择一些用于链接的文本，然后单击“插入链接”按钮 <img alt="insert-hyperlink_22px" src="../Images/insert-hyperlink_22px.png"/>：</p>

  <div class="image">
    <img alt="tutorial-links-insert-link" src="../Images/tutorial-links-insert-link.png"/>
  </div>

  <p>This will open the Select Target dialog which shows you the IDs in your book that you can link to:</p>
  <p>这将打开“选择目标”对话框，该对话框显示您可以链接到的图书中的 ID：</p>

  <div class="image">
    <img alt="tutorial-links-insert-link-dialog" src="../Images/tutorial-links-insert-link-dialog.png"/>
  </div>

  <p>You will notice a number of different IDs in the list. At first it might not look like yours is there, so to find it, it helps to understand what a link looks like:</p>
  <p>您会在列表中注意到许多不同的 ID。刚开始时，它看起来可能不像您那里，因此找到它有助于了解链接的外观：</p>

  <ul>
    <li><span class="listheading">Filename.html:</span> This points to just a filename as the target of your link and tells the link to jump to the top of the file. This is what is used for the Generate Table Of Contents links.</li>
    <li><span class="listheading">Filename.html：</span>这仅指向链接目标的文件名，并告诉链接跳至文件顶部。这就是用于“生成目录”链接的内容。</li>

    <li><span class="listheading">Filename.html#ID1:</span> This points to a specific ID in a file. When you use this as the target of your link the reader will go to the exact location of the text with the ID in the file listed.</li>
    <li><span class="listheading">Filename.html#ID1：</span>指向文件中的特定 ID。当您将其用作链接目标时，阅读器将转到列出文件中带有 ID 的文本的确切位置。</li>

    <li><span class="listheading">#ID1:</span> This is just the ID name, and implies that it is in the same file as your link so no filename is needed.</li>
    <li><span class="listheading">#ID1：</span>这只是 ID 名称，表示它与链接位于同一文件中，因此不需要文件名。</li>
  </ul>

  <p>When you select a link you will see that the Target text box shows the actual link that will be used. Click <span class="buttonbox">OK</span>, or double-click on an entry, and the link will be created for your text.</p>
  <p>选择链接后，您会看到“目标”文本框显示了将要使用的实际链接。单击<span class="buttonbox">确定</span>，或双击一个条目，然后将为您的文本创建链接。</p>

  <p>If you click on the newly created link in your text you will jump to where the ID is. You can then click the Back button <img alt="back-to-link-style_22px" src="../Images/back-to-link-style_22px.png"/> to return to where you clicked the link.</p>
  <p>如果单击文本中新创建的链接，您将跳至 ID 所在的位置。然后，您可以单击“后退”按钮 <img alt="back-to-link-style_22px" src="../Images/back-to-link-style_22px.png"/> 返回到单击链接的位置。</p>

  <h4 class="sigil_not_in_toc">反向链接</h4>

  <p>Most ereaders have a Back button that you can select once you follow a link to take you back to the original linked text. But for those that don’t, you can create a link from your destination back to your original source text. This is often called reverse linking.</p>
  <p>大多数电子阅读器都有一个“后退”按钮，您可以在单击链接后选择该按钮，以将您带回到原始链接的文本。但是对于那些没有的链接，您可以创建从目标位置到原始源文本的链接。这通常称为反向链接。</p>

  <p>Reverse linking is just like any other kind of linking – it just means you have to create a link from the source text to your destination note, and also from your destination note back to your source text – so both source and destination will need IDs and links, and will be mirror versions of each other:</p>
  <p>反向链接与任何其他类型的链接一样-意味着您必须创建一个从源文本到目标注释的链接，并且还需要从目标注释返回到源文本的链接——因此源和目标都将需要 ID 和链接，并且将是彼此的镜像版本：</p>

  <div class="image">
    <img alt="note" src="../Images/note.png"/>
  </div>

  <p>For example, in the typical case of creating endnotes:</p>
  <p>例如，在创建尾注的典型情况下：</p>

  <ul>
    <li>Select your note at the end of your book (or chapter) and assign an ID to it, e.g. <span class="example">note1</span>.</li>
    <li>在书（或章）的末尾选择笔记，并为其分配一个 ID，例如 <span class="example">note1</span>。</li>

    <li>Select your text in the book and assign an ID for it, e.g. <span class="example">text1</span>.</li>
    <li>在书中选择您的文字并为其指定一个 ID，例如 <span class="example">text1</span>。</li>

    <li>Select the same text again and create a link to the note’s ID.</li>
    <li>再次选择相同的文本，然后创建指向注释ID的链接。</li>

    <li>Select your note again (click on the link to jump you to the note and to test the link), and create a link pointing back to your text’s ID.</li>
    <li>再次选择您的笔记（单击链接以跳至该笔记并测试链接），然后创建一个指向文字ID的链接。</li>

    <li>Click on the note to jump you back to your text to test the link.</li>
    <li>单击注释可将您跳回文本以测试链接。</li>
  </ul>
</body>
</html>